<?php
session_start();
$news_title =   $_POST['news_title'];
$caption    =   $_POST['caption'];
$content    =   $_POST['content'];
$posted_by  =   $_SESSION['name'];
$day        =   $_POST['day'];
$cat_id     =   $_POST['category'];
$location   =   $_POST['location'];
$posted_on  =   date("d-m-Y  H:i");

$news_id = $_POST['news_id'];


    include "db_connect.php";
    $query = "UPDATE `news` SET  `id` = '$news_id' , `news_title` =  '$news_title',`caption` =  '$caption',`content` =  '$content',
    `posted_by` =  '$posted_by',`posted_on` = '$posted_on',`category_id` = '$cat_id' where `id` = $news_id";
    if(mysql_query($query))
    header("location:../admin.php?page=news_show&news_id=$news_id");
        else{
        mysql_error();
        die("Update Failed");
        }

?>